import { defineStore } from 'pinia';
import { ref } from "vue";

export const useCartStore = defineStore('cart', () => {
    const cartQuantity = ref(0);

    const updateCartQuantity = (newCartQuantity) => {
        cartQuantity.value = newCartQuantity;
    };

    const resetQuantity=()=>{
        cartQuantity.value = 0
    }

    return {
        cartQuantity,
        updateCartQuantity,
        resetQuantity
    };
}, {
    persist: true
});